import service from '@/utils/request'

// 注册
export const register = (data) => {
    return service({
        method: 'post',
        url: '/user/register',
        data
    })
}
// 登录
export const login = (data) => {
    return service({
        method: 'post',
        url: '/user/login',
        withCredentials: true, // 增加cookie跨域
        data
    })
}

// yanzheng
export const verify = (data) => {
    return service({
        method: 'post',
        url: '/user/verify',
        data
    })
}

// yanzheng
export const resetPassword = (data) => {
    return service({
        method: 'post',
        url: '/user/resetPassword',
        data
    })
}

// 获取验证码
export const getCaptcha = () => {
    return service({
        method: 'get',
        url: '/user/getCaptcha',
        withCredentials: true // 增加cookie跨域
    })
}

// 获取验证码
export const sendCode = (data) => {
    return service({
        method: 'post',
        url: '/user/sendCode',
        data
    })
}